import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: () => import('@/views/Layout'),
    children: [
      {
        path: '/',
        name: 'home',
        component: () => import('@/views/Layout/routers/home.vue')
      },
      {
        path: '/question',
        name: 'question',
        component: () => import('@/views/Layout/routers/question.vue')
      },
      {
        path: '/video',
        name: 'video',
        component: () => import('@/views/Layout/routers/video.vue')
      },
      {
        path: '/user',
        name: 'user',
        component: () => import('@/views/Layout/routers/user.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login')
  },
  {
    path: '/profile',
    name: 'profile',
    component: () => import('@/views/user/profile.vue')
  },
  {
    path: '/chat',
    name: 'chat',
    component: () => import('@/views/user/chat.vue')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/search')
  },
  {
    path: '/result',
    name: 'result',
    component: () => import('@/views/search/result.vue')
  },
  {
    path: '/article',
    name: 'article',
    component: () => import('@/views/article')
  }
]

const router = new VueRouter({
  routes
})

export default router
